UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3PjJMR6vaKczWNCz/PIF55AYIxSTr7estU2Pk8UCe1I='
WHERE
key_id = '2cc4cb3cf7126605098b5b013856037c0fb93c7c20407bf593768647076119b4'
AND (
token = '3PjJMR6vaKczWNCz/PIF55AYIxSTr7estU2Pk8UCe1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)