UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1vvtehJOQh+JnO+HHjXFbsbz81rU5LGEPMVN7aKHQXA='
WHERE
key_id = 'bf97e211cc01f3a989df2914be04200102d2fd66f0b2bec6bffee205a3489799'
AND (
token = '1vvtehJOQh+JnO+HHjXFbsbz81rU5LGEPMVN7aKHQXA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)