UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vkTm6H/fBfDOHsBRCh5Q2Q2SjLoZIS2GdS5Ojrao5BA='
WHERE
key_id = 'a77f7d0fca6920480d5b8359dbba54d701699aab25416b2e6fbcb10a29323410'
AND (
token = 'vkTm6H/fBfDOHsBRCh5Q2Q2SjLoZIS2GdS5Ojrao5BA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)