UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fzw/V65iuya4Yj2eGrNMsQRNGtquSIF40V4t1F4Fao0=' 
WHERE 
  key_id = '3105410c122d0ae930e578d2f6f92fdeaf9aa7f1cf8006d3aeb870a51820c712' 
  AND (
    token = 'fzw/V65iuya4Yj2eGrNMsQRNGtquSIF40V4t1F4Fao0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028