UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vJp1ShKy5W9tY0DDUTh8/eg1P1FfASs1E9srsoNm8pw=' 
WHERE 
  key_id = '3af14f1621ee37a2ad62fee73265c30e09f3d7a18e125c7c63dae16e9a965f46' 
  AND (
    token = 'vJp1ShKy5W9tY0DDUTh8/eg1P1FfASs1E9srsoNm8pw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053