UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oR3PtO4bF+72E6BfwYZo3j/h5oo/D/+DtBsyt/YFk4s='
WHERE
key_id = 'd2f90b9defa61f55964435394501e6f5d499bf2ea184fc3ac56f2a7030d3d7b1'
AND (
token = 'oR3PtO4bF+72E6BfwYZo3j/h5oo/D/+DtBsyt/YFk4s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)