UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hfKqLVMEEgnd0YgEGRPaGEOylMgUB6U5X95MkycXr28='
WHERE
key_id = '67b5a3a0d478a7bb6649137abab11fc3d50e71427b9ef824aae1d1d94e1ad6a5'
AND (
token = 'hfKqLVMEEgnd0YgEGRPaGEOylMgUB6U5X95MkycXr28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)