UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FXtP3K/8up8Xx183PtEUZsWngU8DXDvRhnlXQfsdNmY='
WHERE
key_id = '6b3a9ca7a3b903d45288904cbb062629edb73b540a19bd64a7984d52d324a7a0'
AND (
token = 'FXtP3K/8up8Xx183PtEUZsWngU8DXDvRhnlXQfsdNmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)