UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4PActJoqAVbemnmwmfF+mfti53g9tjvw9HKZyB3K0E0=' 
WHERE 
  key_id = 'd62bd3fa96c0baa74c16fd4643c5d48f7ec0f7b11570f24ff96a9369e20ec8b3' 
  AND (
    token = '4PActJoqAVbemnmwmfF+mfti53g9tjvw9HKZyB3K0E0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00127