UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C91+aoDDB16YodeH7DCCCZrQWllPBQCspoyXKfoY7bI=' 
WHERE 
  key_id = '626d3e26182ee7759f8ac000428ff56b39c7e2a0dc5ef6ff8d112b7e31b27383' 
  AND (
    token = 'C91+aoDDB16YodeH7DCCCZrQWllPBQCspoyXKfoY7bI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017