UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3yZqiRUq2hSsVQeG2ikGyQbziYpr/HsqMY/Qalb8fzw='
WHERE
key_id = '189b5b73425f6af56b543e1211c1e78c9d62c0140f3d75dd2d0728d2ded32b0d'
AND (
token = '3yZqiRUq2hSsVQeG2ikGyQbziYpr/HsqMY/Qalb8fzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)