UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q5FbJMfUF+Y3lYir0PhCXlg2md6NM74fU1KVRirUIhA='
WHERE
key_id = 'b604100901cd23a6438e96321f6ecb8359a79f25961f51060529ad40074331b6'
AND (
token = 'q5FbJMfUF+Y3lYir0PhCXlg2md6NM74fU1KVRirUIhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)