UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vluc4fHLGqWYhXdPeRVmZDBaKYwww6vo/28zZnuy35U='
WHERE
key_id = '6dcffe6f99f823ea9f1a418b9d930d1dd01fdff8bd3d6c2d58c8d9ae0a2fcbf6'
AND (
token = 'vluc4fHLGqWYhXdPeRVmZDBaKYwww6vo/28zZnuy35U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)