UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2g3rsP/BKq6SbUVr1tySkgdC10Vb+XeS1sa6TEB2tS0=' 
WHERE 
  key_id = '284edcaf55fc755582c1ac05f81f0989d5a9e88032cb5d23a3fde3a96468f75b' 
  AND (
    token = '2g3rsP/BKq6SbUVr1tySkgdC10Vb+XeS1sa6TEB2tS0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042