UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bkIIyxhm8BcTA7K7Vz9Gk9rzeeteXs1bfxACsuoVmjo=' 
WHERE 
  key_id = '3c073557e33ea57e9fcc9a7c3cdd92cbfb5a105be506db865f9f8aa4e411c366' 
  AND (
    token = 'bkIIyxhm8BcTA7K7Vz9Gk9rzeeteXs1bfxACsuoVmjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034