UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ufqj4cdA1ZlaHFl12QBp+hQ/pGNxPJ442uJ6M81GU8g=' 
WHERE 
  key_id = '90526374634d9213cc71b0bb2bb1d9881202e6b78656d841d8dab6e10a449d41' 
  AND (
    token = 'Ufqj4cdA1ZlaHFl12QBp+hQ/pGNxPJ442uJ6M81GU8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040