UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EqJdyMCZlMYRtF3fu4jIaeZKnuV9PJi8vkRp/sQACmk='
WHERE
key_id = '42217799b7f08028e22065fe9fecd62a17668379c12069c26f89010304bd07c0'
AND (
token = 'EqJdyMCZlMYRtF3fu4jIaeZKnuV9PJi8vkRp/sQACmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)