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