UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'odj+sEZ1RPoWzCGpZO14r9xMVTcPzO2HVxhFMZ1dXEw=' 
WHERE 
  key_id = '56ec896a35620fc01c6a285e2fdd69d35c0494e732a15438e75e455c12cc9b6e' 
  AND (
    token = 'odj+sEZ1RPoWzCGpZO14r9xMVTcPzO2HVxhFMZ1dXEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039