UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K3buW/TZSMb2G/Vd1NeUxWWT90PxXyc4qi5X4VKr+aw=' 
WHERE 
  key_id = '9eeb84caa034395fbcdca74b2bef594906eb3e63c2215c99846fe92f2646e4f1' 
  AND (
    token = 'K3buW/TZSMb2G/Vd1NeUxWWT90PxXyc4qi5X4VKr+aw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046