UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6+Xiyj+ABkcv9/sbafoj61JF0ZpP9CMvMiBt90/xusg='
WHERE
key_id = 'dda6dcc8a449f624b86080bbd786409620cbc35fd87e86ba3f3a793f66ff6eed'
AND (
token = '6+Xiyj+ABkcv9/sbafoj61JF0ZpP9CMvMiBt90/xusg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)