UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ijS6UcWgC0CK9MF3scqABVb05sIro3v0b2mdEbFXdho='
WHERE
key_id = 'dc2210550c1da7addecbf94ceea9cc011280e24f46ca707ad899d3719930d6d5'
AND (
token = 'ijS6UcWgC0CK9MF3scqABVb05sIro3v0b2mdEbFXdho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)