UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w+Tj1hN/Xq25k/vkWm061YiU65EI3LZCQ/8d5Gf1fAY=' 
WHERE 
  key_id = 'e8ce394319783256ca1b460116de8a91afa585868cd19b7a5e9d753f7c486ad8' 
  AND (
    token = 'w+Tj1hN/Xq25k/vkWm061YiU65EI3LZCQ/8d5Gf1fAY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026