UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zw6bCfOD3h/J3uoMv6E/d8IPAG8sFFsxV+vx5JY4lSY=' 
WHERE 
  key_id = 'c485017304cec5c234ae780b3f5655ca277b51a4cbf2c0c14907f256f44718da' 
  AND (
    token = 'zw6bCfOD3h/J3uoMv6E/d8IPAG8sFFsxV+vx5JY4lSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038