UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gOldFq0NtNXgmde31PwZ7MaO/W3reOhm+J76xmFOK5A='
WHERE
key_id = 'c976d14baac4e2b725b9571fa29d0c0747b4c725610ddd3cbfcc9b2631f00998'
AND (
token = 'gOldFq0NtNXgmde31PwZ7MaO/W3reOhm+J76xmFOK5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)