UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SZrzBGk9eHtXpHTdSgYbVACyvRnZ1UyYnuriDy1XnDI='
WHERE
key_id = '148219f06d8f796f8a2f1a177d471c89b181b3241dd0d8d0ddddc65b498945be'
AND (
token = 'SZrzBGk9eHtXpHTdSgYbVACyvRnZ1UyYnuriDy1XnDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)