UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ne+8h3v0CU6fqLrOTyTZ4lP2F1nGyVrYt87Fqo9fado='
WHERE
key_id = 'fee48d96c221db5db6438ec7c2c698846bdbd0645740bc5cb485e1eeaf19f158'
AND (
token = 'ne+8h3v0CU6fqLrOTyTZ4lP2F1nGyVrYt87Fqo9fado='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)