UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cuEFJ3NHomx3LEYkqMgRj6FGUEBw/BibN8N1N2aIjqs='
WHERE
key_id = '487124b621901d4db5611019977c1d11d46f743f380fc6d5b829986c8899de15'
AND (
token = 'cuEFJ3NHomx3LEYkqMgRj6FGUEBw/BibN8N1N2aIjqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)