UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wwNn4QswRfl7S0yCjpD/l6oaZQtTCE9aHGx4gZKILmU=' 
WHERE 
  key_id = '6a90c0d3987bf5092791bdf9653f9842e381afd69c1a570de4d7fe52774cd61e' 
  AND (
    token = 'wwNn4QswRfl7S0yCjpD/l6oaZQtTCE9aHGx4gZKILmU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029