UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o2igpUqvkMuicJuZJDWKgfMkSdXAf8UQ9PGpYVyfmuM='
WHERE
key_id = '2f2eb830f554cf41f9908ea61edb27181364158e1f9036c5b0430c8d401841dd'
AND (
token = 'o2igpUqvkMuicJuZJDWKgfMkSdXAf8UQ9PGpYVyfmuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)