UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'keVjq6ELRONIlp6MOw/DjmEfVwBC6ogS2+x0HjmN2dI='
WHERE
key_id = '86b160a52fa38562a9810b973fe9d4fbe40baaf683b39bf37ae89bc0c626ea9e'
AND (
token = 'keVjq6ELRONIlp6MOw/DjmEfVwBC6ogS2+x0HjmN2dI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)