UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ARJ8lvp+q5fhwzuWZY8AZ9g3cf25q+Zyq69D4v+qBWk=' 
WHERE 
  key_id = '0425fb2dfed73cf3ad81be4a41297aa37292884a046dd54d4f877aec341bfbb9' 
  AND (
    token = 'ARJ8lvp+q5fhwzuWZY8AZ9g3cf25q+Zyq69D4v+qBWk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040