UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AIRDyQ7f1g/hiYtKmJCM0S/fDPG/JLOHMnR9J+flI0c=' 
WHERE 
  key_id = 'eae7f26c57a62ed8f720424b7c97e5316f828012584dd56451df1a42168d1a8d' 
  AND (
    token = 'AIRDyQ7f1g/hiYtKmJCM0S/fDPG/JLOHMnR9J+flI0c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027