UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7dyPkRgMHodCXJmcpxduOWlhwmN2Cja7RLHn4Rp9Hj0=' 
WHERE 
  key_id = '22802b4871adc51a59a22c106003027a91c91dda99c66a19ed80b77bf46c526f' 
  AND (
    token = '7dyPkRgMHodCXJmcpxduOWlhwmN2Cja7RLHn4Rp9Hj0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059