UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kl0WBA0l6lJFD0fSAMDzEKPNRX3273oIEQGfrd8GbIg='
WHERE
key_id = '52955bd0af90ca3e9ddb2edb79a5fce6a17b2a131dba4309455447e81abfb80e'
AND (
token = 'Kl0WBA0l6lJFD0fSAMDzEKPNRX3273oIEQGfrd8GbIg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)